<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        window.onload = function(){
            var btn1 = document.getElementById("btn1");
            var box1 = document.getElementsByClassName("box1")[0];
            btn1.onclick = function(){
                // 通过js修改元素的样式，格式：元素对象.style.样式名 = 样式值
                // 这改变的是CSS的内联样式，优先级高，可以覆盖掉原来的样式
                box1.style.width = "200px";
                box1.style.height = "200px";
                box1.style.backgroundColor = "skyblue";
            };
        };
    </script>
    <style>
        .box1{
            width: 100px;
            height: 100px;
            background-color: orange;
        }
    </style>
</head>
<body>
    <div class="box1"></div>
    <button id="btn1">按钮一</button>
</body>
</html>